﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dracham.Classes
{
    public enum EffectType : int
    {
        Physical = 1,
        Magic = 2
    }

    public partial class SpellEffect
    {
        public Int32 CalculateDamage(MobileObject o)
        {
            if (o.GetType() == typeof(Character))
            {
                Character c = (Character)o;

                float modifier = this.Coefficient;
                switch ((EffectType)this.DamageType)
                {
                    case EffectType.Physical:
                        modifier = modifier * c.Strength;
                        break;
                    case EffectType.Magic:
                        modifier = modifier * c.Intelligence;
                        break;
                }

                return Utility.Random(this.DamageMin * modifier, this.DamageMax * modifier);
            }
            else if (o.GetType() == typeof(Creature))
            {
                Creature c = (Creature)o;

                return 4;
                //return Utility.Random(this.DamageMin * this.Coefficient, this.DamageMax * this.Coefficient);
            }
            
            return 0;
        }
    }
}
